package com.aqielife.demo.elasticsearch.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.LocalDateTime;

import static org.springframework.data.elasticsearch.annotations.DateFormat.date_hour_minute_second;

/**
 * @author aqie
 * @date 2022/02/07 14:32
 * @desc
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@Document(indexName = "student")
public class StudentEs {
  @Id
  private Long studentId;

  @Field
  private String tenantId;

  @Field(type = FieldType.Keyword)
  private String code;

  @Field
  private Long classId;

  @Field(type = FieldType.Keyword)
  private String name;

  @Field(type = FieldType.Keyword)
  private String idCard;

  @Field(type = FieldType.Date,format = date_hour_minute_second)
  private LocalDateTime createTime;
}
